FROM microsoft/dotnet:sdk AS build-env
WORKDIR /code
COPY *.sln /code
RUN dotnet restore 

COPY . /code
RUN dotnet publish -c Release -o /code/out

FROM microsoft/dotnet:runtime
WORKDIR /app
COPY --from=build-env /code/out /app
ENTRYPOINT ["dotnet","DockerSample.ConsoleApp.dll"]

